package domein;

/**
 * Subclass of Message class to send file meta data from sender to receiver.
 *
 * @author Colin Bundervoet
 * @author Jeroen Pattyn
 */
public class MessageFileMetaData extends Message
{
    private int filesize;
    private String ip;
    private int port;
    private String sendername;

    /**
     * Constructor for MessageFileMetaData class
     *
     * @param filename name of the file
     * @param filesize size of the file
     * @param port the port on which the sender is listening
     * @param ip the ip on which the sender is listening
     * @param sendername the username of the sender
     */
    public MessageFileMetaData(String filename, int filesize, int port, String ip, String sendername) {
        super(MessageType.FILEMETADATA, filename);
        this.filesize = filesize;
        this.port = port;
        this.ip = ip;
        this.sendername = sendername;
    }

    /**
     * File size of the to be transfered file.
     *
     * @return integer file size.
     */
    public int getFilesize() {
        return filesize;
    }

    /**
     * IP of the sending client.
     *
     * @return String representation of the ip.
     */
    public String getIp() {
        return ip;
    }

    /**
     * Port to transfer file over.
     *
     * @return integer port.
     */
    public int getPort() {
        return port;
    }

    /**
     * Username of the sender at the moment of sending.
     *
     * @return String username of the sender.
     */
    public String getSendername() {
        return sendername;
    }
}
